import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import BasicLayout from '@/components/BasicLayout.vue'
import NotFound from '@/views/NotFound.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: BasicLayout,
      redirect: '/home',
      children: [
        {
          path: '/home',
          name: 'Home',
          component: () => import('@/views/Home.vue')
        },
        {
          path: '/brand',
          name: 'Brand',
          component: () => import('@/views/Brand.vue')
        },
        {
          path: '/rfq',
          name: 'Rfq',
          component: () => import('@/views/SendRfq.vue')
        },
        {
          path: '/about',
          name: 'About',
          component: () => import('@/views/About.vue')
        },
        {
          path: '/detail',
          name: 'Detail',
          component: () => import('@/views/Detail.vue')
        },
        {
          path: '/rfqresult',
          name: 'RfqResult',
          component: () => import('@/views/RfqResult.vue')
        },
      ]
    },
    {
      path: '/product/file',
      name: 'File',
      component: () => import('@/views/File.vue')
    },
    // 404路由配置 - 放在所有路由的最后
    {
      path: '/:pathMatch(.*)*',
      name: 'NotFound',
      component: NotFound
    }
  ],
})

export default router
